Skip to content

Conversation

@jmarrero
Copy link
Contributor

@jmarrero jmarrero commented Jul 8, 2025

When we do a reboot it is triggered inside the bootc namespace. As we implement support for soft-reboots we need to make sure that systemd has a view into the mounted /run/nextroot to be able to act on doing a soft-reboot or a reboot. By using systemd-run we avoid the limited view in the current namespace.

@jmarrero jmarrero mentioned this pull request Jul 8, 2025
4 tasks
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

The code changes modify the reboot function to use systemd-run for executing the reboot command. This ensures that systemd has the correct view into the mounted /run/nextroot directory, which is necessary for soft-reboots. I suggested adding a message to the systemd-run command to improve logging and debugging.

Comment on lines 16 to 18
Task::new("Rebooting system", "systemd-run")
.args(["reboot"])
.run()?;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Consider adding a --message argument to systemd-run to provide a user-friendly message about the reboot, which can be displayed in system logs or by system monitoring tools. This can aid in debugging and understanding the reason for the reboot, especially in automated environments.

Suggested change
Task::new("Rebooting system", "systemd-run")
.args(["reboot"])
.run()?;
.args(["--message=Rebooting system", "reboot"])
.run()?;

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Huh cool that it knows about this! It's unrelated to this change, but we might as well do so. How about --message=Initiated by bootc?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be cool if that was a valid argument 😆
Not sure where Gemini got this from, but I can't find it in any manpages.

#1416

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wanted to followup on this specifically: Gemini didn't hallucinate in that sense, --message does exist as an argument...but for systemctl. It did mess up the patch. And the two humans here messed up in not double checking it.

In my case, I incorrectly believed we had CI covering this (which is totally my fault again!). Also, it's kind of subtle but visually when I was glancing at the PR, the removed lines have reboot and the added lines have --message and so (again at a super quick glance) it read to me like "reboot --message".

Finally and most importantly: I myself a while ago added a similar patch in the OpenShift MCO (though ironically actually, using --description for systemd-run now that I look...) but I did know that --message existed.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

man... I kept thinking how did this work for me locally when I saw the fallout. I did test what I originally submitted but never tested with --message

@cgwalters
Copy link
Collaborator

CI here is https://gitlab.com/redhat/centos-stream/containers/bootc/-/issues/1174 biting us - again skew between containers and rpms (cc rpm-software-management/dnf5#833 )

When we do a reboot it is triggered inside the bootc namespace.
As we implement support for soft-reboots we need to make sure
that systemd has a view into the mounted /run/nextroot
to be able to act on doing a soft-reboot or a reboot.
By using systemd-run we avoid the limited view in the current
namespace.

Signed-off-by: Joseph Marrero Corchado <[email protected]>
@cgwalters cgwalters enabled auto-merge July 8, 2025 18:39
@cgwalters cgwalters merged commit e7d15d4 into bootc-dev:main Jul 8, 2025
25 of 34 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants